<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/business/include/doctype.jsp" %>
<link rel="stylesheet" type="text/css" href="/js/jquery-ui-1.8.14.custom/css/ui-lightness/jquery-ui-1.8.14.custom.css" />

<script type="text/javascript">
function goSubmit() {
	
	if(document.form.nabgi_desc.value==""){
		  alert("납기조정사유를 입력하세요!");
		  document.form.nabgi_desc.focus();
		  return false;
	}
	
	//요청내역 Max 1,000자 체크
	if ( document.form.nabgi_desc.value.length > 1000 )
		{
			alert( "납기조정사유는 1000자로 제한됩니다. 긴 문장은 첨부파일로 첨부해 주시기 바랍니다. \n현재 " + eval(document.form.detail.value.length ) + "자 입니다." );
			document.form.nabgi_desc.focus();
			return false;
		}

	//희망완료일 체크
	if(document.form.nabgi_date.value==""){
	  alert("희망완료일을 선택하세요!");
	  document.form.nabgi_date.focus();
	  return false;
	}

}

function SetDesc(rnum){
	<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
	Desc${mapInfo.num} = "${mapInfo.desc}";
	</c:forEach>
	
	document.form.accept_desc.value = eval("Desc"+rnum);
}

function goSbumit(nval){
	
	var chks = document.getElementsByName("radio");
	var res = "";
	for(var i=0;i<chks.length;i++){
		if (chks[i].checked){
			res = res + chks[i].value;
		}
	}
	if (nval == null || nval == undefined || nval != 'Y') {
		if(res == 0){
			alert("라디오 버튼을 선택해주세요.");
			return;		
		}
		if(document.form.accept_desc.value == ""){
			alert("처리계획 내용을 입력하세요.");
			return;
		}
	}
	if(nval == "Y"){
		document.form.atOnce_btn.value="Y";
	}
	if (confirm('처리하시겠습니까?')) {
		document.form.submit();
	}
	return;
}
</script>

</head>
<body>
<div id="wrap">
		<div class="header">
			<h1>SERVICE DESK</h1>
		</div><!-- // header -->
		<div class="content">
			<h3>처리계획 알림 상황별 모범알림</h3>
			<p class="reason1">완료예정일 및 처리계획, 요청 내역 협의사항을 간단하게 기술하여 고객에게 통보해 주십시요.</p>
			<div class="service">
				<form name="form" action="${requestScope.contextPath}/business/mServiceDesk_/mServiceDeskNotification.do" method="post" >	
				<input type="hidden" name="MODE" value="Save">
				<input type="hidden" name="page" value="1">
				<input type="hidden" name="Ref_Num" value="${Ref_Num}">
				<input type="hidden" name="Ref_Type" value="${Ref_Type}">
				<input type="hidden" name="atOnce_btn" value="">
				<div class="table5" style="border-top:solid 1px #84b6ea;">
					<table summary="" cellspacing="0" style="width:100%;">
						<caption>처리계획 알림</caption>
						<colgroup>
							<col style="width:25%" />
							<col style="width:30%" />
							<col style="width:5%" />
							<col style="width:15%" />
							<col style="width:5%" />
							<col style="width:15%" />
						</colgroup>
						<tbody>
							<tr>
								<th scope="row" rowspan="2">Assignee<br />미지정</th>
								<td>고객 연락됨</td>
								<th scope="row"><input type="radio" name="radio" value="1" onclick="SetDesc(this.value)" id="radio1" /></th>
								<td><label for="radio1">통화 후</label></td>
								<th scope="row"><input type="radio" name="radio" value="2" onclick="SetDesc(this.value)" id="radio2" /></th>
								<td><label for="radio2">통화 중</label></td>
							</tr>
							<tr>
								<td>고객 연락안됨</td>
								<th scope="row"><input type="radio" name="radio" value="3" onclick="SetDesc(this.value)" id="radio3" /></th>
								<td colspan="3"><label for="radio3">고객 부재중 알림</label></td>
							</tr>
							<tr>
								<th scope="row" rowspan="2" class="yellow">Assignee<br />직접알림</th>
								<td>요청내역협의필요</td>
								<th scope="row" class="yellow"><input type="radio" name="radio" value="4" onclick="SetDesc(this.value)" id="radio4" /></th>
								<td colspan="3"><label for="radio4">처리계획 알림</label></td>
							</tr>
							<tr>
								<td>요청내역협의필요</td>
								<th scope="row" class="yellow"><input type="radio" name="radio" value="5" onclick="SetDesc(this.value)" id="radio5" /></th>
								<td><label for="radio5">연락됨</label></td>
								<th scope="row" class="yellow"><input type="radio" name="radio" value="6" onclick="SetDesc(this.value)" id="radio6" /></th>
								<td><label for="radio6">연락안됨</label></td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="table5 desk">
					<table summary="" cellspacing="0" style="width:100%;">
						<caption>처리계획 알림</caption>
						<colgroup>
							<col style="width:40%" />
							<col style="width:60%" />
						</colgroup>
						<tbody>
							<tr>
								<th scope="row">Assignee<br />부재로 대신알림</th>
								<td><input type="radio" name="radio" value="7" onclick="SetDesc(this.value)" id="radio7" /> <label for="radio7">assignee 부재중 알림</label></td>
							</tr>
							<tr>
								<th scope="row" class="yellow">필드 지원업무 알림<br />(pc,iken,w 등)</th>
								<td><input type="radio" name="radio" value="8" onclick="SetDesc(this.value)" id="radio8" /> <label for="radio8">필드 지원 알림</label></td>
							</tr>
							<tr>
								<td colspan="6"><textarea cols="" rows="3" name="accept_desc" class="comment"></textarea></td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="btn_area1">
					<p class="left_area1"><a href="javascript:goSbumit('Y')"><img src="${requestScope.contextPath}/images/btn/btn_now.gif" alt="즉시처리" /></a></p>
					<p class="left_area1"><a href="javascript:goSbumit()"><img src="${requestScope.contextPath}/images/btn/btn_alarm.gif" alt="처리알림" /></a></p>
					<div class="right_area">
						<p><a href="javascript:history.back();"><img src="${requestScope.contextPath}/images/btn/btn_reset.gif" alt="취소" /></a></p>
					</div>
				</div>
				</form>
		</div><!-- // content -->
	</div><!-- // wrap -->
	
</body>
</html>